/*
 * dataframeiterator.h
 *
 *  Created on: Jul 14, 2009
 *      Author: zaca
 */

#ifndef DATAFRAMEITERATOR_H
#define DATAFRAMEITERATOR_H

#include <biosignal/dataframe.h>

#include <tr1/memory>
#include <iterator>

namespace biosignal {

using namespace std::tr1;

class SignalSlice;

class DataFrameIterator: public std::iterator<std::forward_iterator_tag,
            shared_ptr<DataFrame> , long> {
public:
    DataFrameIterator(const SignalSlice* signal_slice, TimePoint time);
    DataFrameIterator();
    DataFrameIterator( const DataFrameIterator& other);
    ~DataFrameIterator();
    bool operator==(const DataFrameIterator & other) const;
    bool operator!=(const DataFrameIterator& other) const;
    shared_ptr<DataFrame> operator*() const;
    shared_ptr<DataFrame> operator->() const;
    DataFrameIterator& operator++();
    //only added for python wrapper
    DataFrameIterator& operator--();
    DataFrameIterator operator++(int);
private:
    TimePoint m_current_time;
    const SignalSlice* m_signal_slice;
    mutable shared_ptr<DataFrame> m_current;
    shared_ptr<const montage::Montage> m_montage;
    void update_current() const;
};

}

#endif /* DATAFRAMEITERATOR_H */
